<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>自制Tab选项卡</title>
    <style>
		.tabs {
            display: flex;
        }
		.tabs div {
            padding: 15px;
			margin-right: 5px;
            background-color: #b8b8b8; 
        }
        .tab-content {
			width: 300px;
			height: 300px;
			display: none;
			background-color: #eabb00; 
        }
        .tabs .alive {
            background-color: #eabb00;
        }
    </style>
	<script src="../js/jquery-1.11.1.js"></script>
	<script>
	    $(function() {
	        $(".tabs div").click(function() {
	            $(".tabs div").removeClass("alive");
	            $(this).addClass('alive');
	            $('.tab-content').removeClass('alive').hide();
	            var abc = $(this).data('tab');
	            $('#tab' + abc).addClass('alive').show();
	        });
	    });
	</script>
</head>
<body>
    <div class="tabs">
        <div data-tab="1">tab1</div>
        <div data-tab="2">tab2</div>
        <div data-tab="3">tab3</div>
    </div>
	
    <div class="tab-content" id="tab1">tab文字内容一</div>
    <div class="tab-content" id="tab2">tab文字内容二</div>
    <div class="tab-content" id="tab3">tab文字内容三</div>
</body>
</html>